
module.exports = function (Sequelize,sequelize) {
    const {STRING,INTEGER,DATE} = Sequelize
    const user = sequelize.define('sys_user', {
        id: {
            type: INTEGER,
            primaryKey: true,
            autoIncrement: true,
            allowNull: false,
            comment: "id",
        },
        username: {
            type: STRING,
            allowNull: true,
            comment: "用户名",
        },
        password: {
            type: STRING,
            allowNull: true,
            comment: "密码",
        },
        email: {
            type: STRING,
            allowNull: true,
            comment: "email",
        },
        realName: {
            type: STRING,
            allowNull: true,
            comment: "真实姓名",
        },
        avatar: {
            type: STRING,
            allowNull: true,
            comment: "头像",
        },
        sex: {
            type: INTEGER,
            allowNull: true,
            comment: "性别",
        },
        status: {
            type: INTEGER,
            defaultValue: 1,
            allowNull: true,
            comment: "状态",
        },
        roleId: {
            type: INTEGER,
            allowNull: true,
            comment: "角色id",
        },
        delFlag: {
            type: INTEGER,
            defaultValue: 0,
            allowNull: true,
            comment: "角色id",
        },
        createTime: {
            type: DATE,
            defaultValue: new Date(),
            allowNull: true,
            comment: "创建时间",
        },
        updateTime: {
            type: DATE,
            defaultValue: new Date(),
            allowNull: true,
            comment: "修改时间",
        },
        uuid: {
            type: STRING,
            allowNull: true,
            comment: "UUID",
        },
        content: {
            type: STRING,
            allowNull: true,
        },
    }, {
        //使用自定义表名
        freezeTableName: true,
        //去掉默认的添加时间和更新时间
        timestamps: false,
    });
    return user
}
